package execution;

import java.util.Iterator;

public class TapeIterator implements Iterator<Byte> {
	
	private TapeNode head;
	
	public TapeIterator (TapeNode head) {
		this.head = head;
	}

	@Override
	public boolean hasNext() {
		return head.getRight() != null;
	}

	@Override
	public Byte next() {
		head = head.getRight();
		return (head == null ? null : head.getDatum());
	}

	@Override
	public void remove() {}
	

}
